|
|
|
|
|
|
|
Listing 11.22. continued |
|
|
|
|
|
|
|
|
Public Property Let LeftTitle(ByVal vNewValue As Variant)
strLeftTitle = vNewValue
End Property
Public Property Get BottomTitle() As Variant
BottomTitle = strBottomTitle
End Property
Public Property Let BottomTitle(ByVal vNewValue As Variant)
strBottomTitle = vNewValue
End Property |
|
|
|
|
|
|
|
|
Because just about any string value could be valid for these properties, no error checking is done at the time the properties are set. In a production application, you might want to add error-checking to protect users. |
|
|
|
|
|
|
|
|
After adding the new properties, you need to update the Class_Initialize event to set the new properties at the start of the object. Listing 11.23 shows the code you need to add to the Class_Initialize event. |
|
|
|
|
|
|
|
|
Listing 11.23. Updating the Class_Initialize event. |
|
|
|
|
|
|
|
|
Private Sub Class_Initialize()
'
' set startup values
'
strDBName = ""
strSQLSelect = ""
strFieldPoint = ""
strTitle = "Data Graph"
intGraphType = dgBar3D
'
' initialize added properties
'
strLegendField = ""
strLabelField = ""
strBottomTitle = ""
strLeftTitle = ""
'
End Sub |
|
|
|
|
|
|
|
|
Now you need to build routines to add the legends and labels to the graph. Create a Private Sub method called AddLegends and enter the code from Listing 11.24. |
|
|
|
|
|